<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class StudentInfo extends Model
{
    //
    protected $table = 'students_info';
    //
    protected $fillable = [
        'student_id', 'xh', 'xm','xbm','csrq','sfzjh','mzm', 'zzmmm','ywb','lxdh', 'status', 'update_desc','zyfx','xsh','nj','school','type'
    ];

    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     */
    public function user()
    {
        return $this->hasOne('App\Models\Student', 'id', 'student_id');
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     */
    public function xshschool(){
        return $this->hasOne(SchoolStatus::class, 'key', 'xsh');
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     */
    public function nation(){
        return $this->hasOne(Nations::class, 'key', 'mzm');
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     */
    public function political(){
        return $this->hasOne(PoliticalOutlook::class, 'key', 'zzmmm');
    }
}
